package com.xcyy.zjdxmjk.zjdxmjk.repository;

import com.xcyy.zjdxmjk.zjdxmjk.entity.Country;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface CountryRepository extends JpaRepository<Country ,String> {
    Country save(Country country);

    List<Country> findByCodeStartsWith(String code);

    @Query(value = " SELECT sum(c.ssfa),sum(c.sjjk),SUM(jcys),count(1) from country c",nativeQuery = true)
    Object countCountry();

    List<Country> findByDept(String dept);

    Country findByCode(String code);
}
